addListener

open override fun addListener(listener: Consumer<ValidatedField<N>>)

Attaches a listener to this field. This listener will be called any time the field is written to ("set"). accept, validateAndSet, setAndUpdate and so on will all call the listener.

Author

fzzyhmstrs

Since

0.5.0

Parameters

listener

Consumer<T>> called whenever the field changes. This should, generally speaking, not try to further modify the fields state unless there is a method to prevent infinite recursion.

See also

withListener

for an extension function that "passes through"